﻿using RPCServer.Attributes;
using RPCServer.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;

namespace RPCServer.Network
{
    class SendArgs : SocketAsyncEventArgs
    {
        public bool HasSendData 
        {
            get
            {
                return SendBuffer.Read(Buffer, Offset, Buffer.Length);
            } 
        }

        MBuffer _sendBuffer;
        public MBuffer SendBuffer 
        {
            get => _sendBuffer;
            set
            {
                if(_sendBuffer!=null)
                {
                    LogManager.Instance.LogError("赋值前 SendBuffer 需为空！");
                }
                else
                {
                    _sendBuffer = value;
                }
            }
        }
    }
}
